package com.lt.service.impl;

import com.lt.dto.MyProject;
import com.lt.dto.teacher.ClosingReview;
import com.lt.dto.teacher.InterimReview;
import com.lt.dto.teacher.ProjectApproval;
import com.lt.mapper.ProjectManageMapper;
import com.lt.service.ProjectManageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author :liteng
 * @Time : 2023/11/6 22:30
 */

@Service
@Slf4j
public class ProjectManageServiceImpl implements ProjectManageService {

    int PROJECT_ESTABLISH_PASSED = 2;
    int PROJECT_ESTABLISH_UNAUDITED = 1;
    int PROJECT_ESTABLISH_FAIL = 3;
    private final ProjectManageMapper projectManageMapper;

    public ProjectManageServiceImpl(ProjectManageMapper projectManageMapper) {
        this.projectManageMapper = projectManageMapper;
    }

    @Override
    public List<MyProject> getAllProject() {
        return null;
    }

    @Override
    public Boolean setStatusAndScore(ProjectApproval projectApproval) {
        Boolean b = projectManageMapper.updateEvaluation(projectApproval);
//        if (b) {
//            int status = projectApproval.getStatus();
//            if (status == PROJECT_ESTABLISH_PASSED){
////                Long projectId = projectApproval.getProjectId();
//
//            }
//        }
        return b;
    }

    @Override
    public Boolean setInterimStatus(InterimReview interimReview) {
        return projectManageMapper.updateInterim(interimReview);

    }

    @Override
    public Boolean setClosingAuditStatus(ClosingReview closingReview) {
        return projectManageMapper.updateClosingAudit(closingReview);
//        return null;
    }



}
